import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CashierOccupyInfoVO, CashierOccupyInfoForm, CashierOccupyInfoQuery } from '@/api/payment/cashierOccupyInfo/types';

/**
 * 查询收银员占用信息列表
 * @param query
 * @returns {*}
 */

export const listCashierOccupyInfo = (query?: CashierOccupyInfoQuery): AxiosPromise<CashierOccupyInfoVO[]> => {
  return request({
    url: '/payment/cashierOccupyInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询收银员占用信息详细
 * @param id
 */
export const getCashierOccupyInfo = (id: string | number): AxiosPromise<CashierOccupyInfoVO> => {
  return request({
    url: '/payment/cashierOccupyInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增收银员占用信息
 * @param data
 */
export const addCashierOccupyInfo = (data: CashierOccupyInfoForm) => {
  return request({
    url: '/payment/cashierOccupyInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改收银员占用信息
 * @param data
 */
export const updateCashierOccupyInfo = (data: CashierOccupyInfoForm) => {
  return request({
    url: '/payment/cashierOccupyInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除收银员占用信息
 * @param id
 */
export const delCashierOccupyInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/payment/cashierOccupyInfo/' + id,
    method: 'delete'
  });
};
